import requests


headers = {
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "Accept-Language": "zh-CN,zh;q=0.9",
    "Cache-Control": "no-cache",
    "Connection": "keep-alive",
    "Pragma": "no-cache",
    "Referer": "http://ggzy.zwfwb.tj.gov.cn/",
    "Upgrade-Insecure-Requests": "1",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
}
cookies = {
    "clientlanguage": "zh_CN",
}
for page in range(1, 20):
    url = f"http://ggzy.zwfwb.tj.gov.cn/jyxx/index_{page}.jhtml"
    response = requests.get(url, headers=headers, cookies=cookies, verify=False)
    with open(f"{page}.html", "w", encoding="utf-8") as f:
        f.write(response.text)
    print(response.text)
    print(response)